//
//  TableHeaderlButton.m
//  Cook
//
//  Created by 0.0 on 15-4-14.
//  Copyright (c) 2015年 dingjun. All rights reserved.
//

#import "TableHeaderlButton.h"

@implementation TableHeaderlButton

- (void)dealloc
{
    [_headerLabel release];
    [_headerImageView release];

    
    [super dealloc];
}


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    if (self) {
        self.headerImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 5, self.frame.size.width / 2, self.frame.size.height / 2)];
        self.headerLabel = [[UILabel alloc] initWithFrame:CGRectMake(_headerImageView.frame.origin.x, _headerImageView.frame.origin.y + _headerImageView.frame.size.height, _headerImageView.frame.size.width, self.frame.size.height - _headerImageView.frame.size.height)];
        self.headerLabel.textAlignment = NSTextAlignmentCenter;
      
        [self addSubview:_headerImageView];
        [self addSubview:_headerLabel];
       
        [_headerImageView release];
        [_headerLabel release];
     
    }
    
    return self;
}

- (void)setImageWithPath:(NSString *)path
{
    [self.headerImageView setImage:[UIImage imageWithContentsOfFile:path]];
}

@end
